<div ng-include="sys_html('common/_header')"></div>
<div class="fui-page order-list-page" ng-if="pagedata.op == 'main'">
	 <div class="jy2-headertopbg">
			<div class="fui-header" style="background:none">
				<div class="fui-header-left">
					<a class="back" style="color:#fff" href="javascript:" ng-click="goback()"></a>
				</div>
				<div class="title bold" style="font-size:1rem;color:#fff">我的订单</div>
				<div class="fui-header-right" style="padding-right:0.5rem;color:#fff" ng-click="pagedata.status=4;tool.get_list('jy_xunichong/order.list/getlist/status=4',true)">
					<a class="icon icon-delete" style="color:#ddd">其他订单</a>
				</div>
			</div>
	 </div>
	<div class="fui-tab fui-tab-danger jy2-headertop" style="top:2.5rem;margin-top:0">
			 <a ng-class="{'external active':pagedata.status == 100}" ng-click="pagedata.status = 100;tool.get_list('jy_xunichong/order.list/getlist/status=100',true)">全部</a>
			<a ng-class="{'external active':pagedata.status == 0}" ng-click="pagedata.status = 0;tool.get_list('jy_xunichong/order.list/getlist/status=0',true)">待付款</a>
			<a ng-class="{'external active':pagedata.status == 1}" ng-click="pagedata.status = 1;tool.get_list('jy_xunichong/order.list/getlist/status=1',true)">待核销</a>
			<a ng-class="{'external active':pagedata.status == 2}" ng-click="pagedata.status = 2;tool.get_list('jy_xunichong/order.list/getlist/status=2',true)">已核销</a>
			<a ng-class="{'external active':pagedata.status == 3}" ng-click="pagedata.status = 3;tool.get_list('jy_xunichong/order.list/getlist/status=7',true)">核销失败</a>
	 
	</div>
	<div class='fui-content order-list' style="margin-top:0.7rem">
		<div class="fui-list-group order-item" ng-repeat="item in pagedata.list">
                <a class="fui-list external" style="padding: 0.42rem 0.5rem" data-nocache="true" ng-click="access_json('jy_xunichong/order.detail//id='+item.id)">
                    <div class="fui-list-inner">
                        <div class="subtitle"> 订单号: {{item.ordersn}}</div>
                    </div>
                    <div class="row-remark text-cancel" style="width: 4rem; font-size: 0.65rem;text-align: right;">{{item.statustitle}}</div>
                    <div class="angle"></div>
                </a> 
					<div>
						<a href="javascript:;">
							<div class="fui-list-group-title lineblock bold">
								<i class="icon icon-dianpu"></i>商品类型 {{item.typetitle}}
								<span class="status noremark" style="font-size:0.50rem" ><i class="icon jinyunicon icon-icon-test"></i></span>
							</div>
						</a>
						<a href="javascript:;" class="external" data-nocache="true" ng-click="access_json('jy_xunichong/order.detail//id='+item.id)">
							<div class="fui-list goods-list">
								<div class="fui-list-media" style="">
									<img class="" ng-src="{{tomedia(item.goods.image) || '../core/resource/images/nopic.jpg'}}">
								</div>
								<div class="fui-list-inner">
									<div class="text goodstitle towline">{{item.goods.title}}</div>
									<div class="text" style="color:#f60;font-size:0.60rem">面值：{{item.oldprice}} x {{item.total || 1}}</div>
									<div class="text"><i class="fui-tag fui-tag-red">{{item.typetitle}}</i></div>
									
								</div>
								<div class="fui-list-angle" style="width:auto">
									<div>￥<span class="marketprice syscolorred">{{item.goods.price}}</span></div>
								</div>
							</div>
						</a>
					</div>
                <div class="fui-list-group-title lineblock">
					<span style="color:#999;font-size:0.65rem"><i class="icon jinyunicon icon-shijian" style="color:#f60;font-size:0.60rem"></i> {{item.createtime}}</span>
                    <span class="status noremark">共 <span>{{item.total}}</span> 个商品 实付: <span class="text-danger">￥{{item.price}}</span></span>
                </div>
            <div class="fui-list-group-title lineblock opblock">
				<span class="status noremark">
					<div ng-show="item.status == 0" class="btn btn-sm btn-default-o order-delete" href="javascript:;" ng-click="pagedata.checkcancel=true;pagedata.orderid=item.id">取消订单</div>
					<div ng-show="item.status == 0" class="btn btn-sm btn-danger-o order-finish" ng-click="pay_submit({},'//pay/id='+item.id,'/order.list/','jy_xunichong/order.list/')">支付订单</div>
					<div ng-show="item.status==1" class="btn btn-sm btn-danger-o order-finish" href="javascript:;" ng-click="access_json('jy_xunichong/order.detail//id='+item.id)">前往核销</div>
					<div ng-show="item.status==5" class="btn btn-sm btn-danger-o order-finish" href="javascript:;" ng-click="access_json('/order.refund/list/orderid='+item.id)">查看退款进度</div>
				</span>
            </div>
        </div>
		<div class="content-empty" ng-show="!pagedata.list || pagedata.list.length == 0 ">
		  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">您暂时没有订单！</p>
		</div>
	</div>
</div>
<!-- 取消订单-->
<div ng-if="pagedata.checkcancel" class="popup">
			<div class="popup-body">
			<div class="popup-center" style="border-radius:0.2rem;">
				<div class="fui-page-title" style="margin-top:1rem">确定要取消订单吗？</div>
				<div class="fui-page-subtitle" style="margin-top:0.1rem">喜欢的商品可能随时会被抢空哦</div>
				<div class="modal-footer" style="margin-top:2rem">
					<a ng-click="pagedata.checkcancel=false" class="mod-fail">取消</a>
					<a href="javascript:" ng-click="post({id:pagedata.orderid},'cancel','id='+pagedata.orderid);pagedata.checkcancel=false" class="mod-success" style="background:{{main.syscolor || 'red'}}">确定</a>
				</div>
			</div>
			</div>
</div>
<div ng-include="sys_html('common/pluginnav',true)"></div>
<script>
scope.tool.get_list('jy_xunichong/order.list/getlist/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_xunichong/order.list/getlist/status='+scope.pagedata.status);
}
</script>